Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multilayerperceptron example added with seaborndataset #51

Merged
merged 1 commit into from
Oct 17, 2023

Conversation

kisharnath
Copy link
Contributor

No description provided.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have already gradle wrapper. Delete this file.

* Knn - K nearest neighbors
* Dataset: Seaborn Penguins
*/
public class MultilayerPerceptronExample2 {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename this to MultilayerPerceptronSeabornExample

Also Rename the old MultilayerPerceptronExample class to MultilayerPerceptronIrisExample


NetworkConfiguration networkConfiguration = new NetworkConfiguration(seabornProvider.getTrainFeatures()[0].length, List.of(32, 6), 3, 0.01, 1000, ActivationFunction.LEAKY_RELU, ActivationFunction.SOFTMAX, LossFunction.CATEGORICAL_CROSS_ENTROPY, Initialization.XAVIER, Initialization.XAVIER);

MultilayerPerceptron multilayerPerceptron = new MultilayerPerceptron(networkConfiguration, testFeatures, testLabels);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have unified Interface for all classifiers. Replace datatype here with

Classifier multilayerPerceptron = ...

import de.edux.functions.activation.ActivationFunction;
import de.edux.functions.initialization.Initialization;
import de.edux.functions.loss.LossFunction;
import de.edux.ml.knn.KnnClassifier;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this import

NetworkConfiguration networkConfiguration = new NetworkConfiguration(seabornProvider.getTrainFeatures()[0].length, List.of(32, 6), 3, 0.01, 1000, ActivationFunction.LEAKY_RELU, ActivationFunction.SOFTMAX, LossFunction.CATEGORICAL_CROSS_ENTROPY, Initialization.XAVIER, Initialization.XAVIER);

MultilayerPerceptron multilayerPerceptron = new MultilayerPerceptron(networkConfiguration, testFeatures, testLabels);
multilayerPerceptron.train(seabornProvider.getTrainFeatures(), labels);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You defined already double[][] features = seabornProvider.getTrainFeatures();

Replace your seabornProvider.getTrainFeatures() call here, with variable features

import java.util.List;

/**
* Knn - K nearest neighbors
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this copy pasted part. Wrong JavaDoc here.

@Samyssmile Samyssmile merged commit a76066b into Samyssmile:main Oct 17, 2023
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants